/***********************************************************************************************************
 * @Author : nanyuantingfeng
 **********************************************************************************************************/
var app, page, nf;
nf = sm("do_Notification");
app = sm("do_App");
page = sm("do_Page");

page.on("back", function(){ app.closePage() });
ui("action_back").on("touch", function(){ app.closePage() });

var storage = sm("do_Storage");
var initdata = sm("do_InitData");
/**********************************************************************************************************/

var listdata = mm("do_ListData");
var listdata2 = mm("do_ListData");

var do_ListView_news = ui("do_ListView_news");
var sv_silder0 = ui("sv_silder0");


// 建立ListView 与 ListData 的行数据关系;
do_ListView_news.bindItems(listdata);


initdata.readFile("initdata://LVdata.json", function(data){// 读取文件
    listdata.addData(data); // 给ListData添加数据
    // 刷新ListView 行数据;
    do_ListView_news.refreshItems();
});
do_ListView_news.rebound();

do_ListView_news.on("touch",function(data, e){
	app.openPage({source:"source://view/news/listviewdemo.ui", data:data, animationType:"", isFullScreen:false, keyboardMode:"default", scriptType:""}, function(data, e){});
});



sv_silder0.bindItems(listdata2);// 建立sliderview 与 ListData 的行数据关系;

listdata2.addData([
    {template : 0},
    {template : 1},
    {template : 2},
    {template : 3}
]);

sv_silder0.refreshItems();
